#include <cmath>
#include "interpolation.h"
class Func : public Function
{
public:
    double operator()(double x)
    {
        return 1 / (1 + x * x);
    }
};

Func func0;

vector<double> x, fvalue;
int n = 6;

void setpoints()
{
    for (int i = 0; i <= n; i++)
    {
        x.push_back(-5 + 10.0 * i / n);
        fvalue.push_back(func0(x[i]));
    }
}

void test()
{
    NewtonPolynomial Pfunc(x, fvalue, n + 1);
    // Pfunc.outputlist();
    // cout << endl;
    // Pfunc.outputtable();
    // cout << endl;
    Pfunc.outputpoly();
}

int main()
{
    setpoints();
    test();
    return 0;
}